Callbacks - Dialogs

The "ask" and "notify" callbacks allow programmers to easily pop modal dialogs from within nShell commands.

NSH_ask

int  NSH_ask(Str255 s, int size);

PARAMETERS

Str255
s;

address of a prompt string

int

size;

size flag (0 = small, 1 = medium, 2 = large)

RETURNS

1

"yes" button pressed

2

"no" button pressed

3

"cancel" button pressed

others

error code

PROCESS

This routine displays a three button modal dialog.  The passed string is displayed within that dialog.  The NSH_ask routine waits until the user selects one of the three buttons.  The return value for the function indicates the button pressed.

NSH_notify

void NSH_notify(Str255 s, int size);

PARAMETERS

Str255
s;

address of a prompt string

int

size;

size flag (0 = small, 1 = medium, 2 = large)

RETURNS

none

PROCESS

This routine displays a modal dialog.  The passed strings is displayed within that dialog.  The NSH_notify routine waits until the user selects an "OK" button.